export default {
  local (key, value) {
    if (arguments.length === 2) {
      return localStorage.setItem(key, JSON.stringify(value))
    } else {
      if(localStorage.getItem(key)!=='undefined') {
        return JSON.parse(localStorage.getItem(key))
      }else {
        return false
      }
      
    }
  },
  session (key, value) {
    if (arguments.length === 2) {
      return sessionStorage.setItem(key, JSON.stringify(value))
    } else {
      return JSON.parse(sessionStorage.getItem(key))
    }
  }
}
